\HeaderA{VaR.backtest}{Backtest of VaR Estimation}{VaR.backtest}
\keyword{htest}{VaR.backtest}
\begin{Description}\relax
Test for given proportions on input data respective a given VaR.
\end{Description}
\begin{Usage}
\begin{verbatim}
VaR.backtest(x, VaR, p)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] Numerical vector of observation.
\item[\code{VaR}] Number or numerical vector of the same length as \code{x}.
\item[\code{p}] Confidence level of VaR estimation.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function performs the test for equal or given proportion (prop.test) on
input data. It calculates a part of observation exceeding a VaR and compares it
with a confidence level of VaR estimation.
\end{Details}
\begin{Value}
Return value is a p.value of prop.test and can be interpretated in a usual
manner.
\end{Value}
\begin{Author}\relax
T. Daniyarov
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{prop.test}{prop.test}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(exchange.rates)
attach(exchange.rates)
y <- USDJPY[!is.na(USDJPY)]
z <- VaR.norm(y)
VaR.backtest(z$cdata, z$VaR, p = 0.01)
detach(exchange.rates)
\end{ExampleCode}
\end{Examples}

